// 导入echarts核心库
import * as echarts from "echarts/core";
// 创建网格布局
import type {

  GridComponentOption,
  
  TitleComponentOption,
  TooltipComponentOption,
  
  LegendComponentOption,
  
} from "echarts/components";

// 导入组件
import {
  GridComponent,
  TooltipComponent,
  LegendComponent,
  TitleComponent
} from "echarts/components";

// 导入图表类型
import {
  LineChart,
  BarChart,
  PieChart
} from "echarts/charts";


// 导入需要使用的图标类型
import type {
  
  LineSeriesOption,
  
  BarSeriesOption,
  
  PieSeriesOption,
} from "echarts/charts";
// 用于添加动画效果
import { UniversalTransition, LabelLayout } from "echarts/features";
// 用于将图表渲染到画布上
import { CanvasRenderer } from "echarts/renderers";
// 将需要使用的组件和方法注入到use里
echarts.use([
  GridComponent,
  LineChart,
  CanvasRenderer,
  UniversalTransition,
  TooltipComponent,
  LegendComponent,
  BarChart,
  TitleComponent,
  LabelLayout,
  PieChart,
]);
// 用于指定配置项参数的
export type EChartsOption = echarts.ComposeOption<
  | GridComponentOption
  | LineSeriesOption
  | TitleComponentOption
  | TooltipComponentOption
  | LegendComponentOption
  | BarSeriesOption
  | PieSeriesOption
>;
export { echarts };
